//
//  MyTableViewCell.m
//  OurMenu
//
//  Created by 尹坤 on 15/10/15.
//  Copyright © 2015年 尹坤. All rights reserved.
//

#import "MyTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation MyTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createMyView];
    }
    return self;
}
- (void)createMyView
{
    self.iconView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.iconView];
    
    self.name = [[UILabel alloc] init];
    [self.contentView addSubview:self.name];
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.iconView.frame = CGRectMake(5, 5, 100, 100);
    self.iconView.backgroundColor = [UIColor redColor];
    self.iconView.layer.cornerRadius = 50;
    self.iconView.layer.masksToBounds = YES;
    
    self.name.frame = CGRectMake(110, 27, 250, 50);
    //self.name.textAlignment = NSTextAlignmentCenter;
    //self.name.backgroundColor = [UIColor greenColor];
    
}
-(void)setDish:(DishesMadels *)dish
{
    self.name.text = dish.title;
    [self.iconView sd_setImageWithURL:[NSURL URLWithString:dish.Aalbums] placeholderImage:[UIImage imageNamed:@"1"]];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
